General Settings
Overview
Activate the Settings tab.
There are 3 general areas each of which may contain settings.
- The system.defaults are for both client side and services side usage.
- The system.servicesOnly are for the services side components. Use this for API keys that are not to be made available client side.
- The Calculation.defaults are for both client side and services side usage.
Each custom area may have a conditional expression to determine whether their expressions are evaluated. This condition is checked at report processing time. A common use is to set values based on the user. The following two functions are the most relevant:
string = signedOnAccount()
list = signedOnTags()
The availability of some Qarbine features are dependent on the edition, release and other factors.
Defining a Setting
Note that calculations are evaluated in top down order. The context menu provides options for reordering elements.
Checking “Active” enables the setting to be used. You may have settings for the same variable but only activate one of them. Checking Read Only sets the variable value to not be changeable by anything downstream.
System.defaults
The system.defaults are for both client side and services side usage. This category is always active.
Default Style Set
This is the default style set for templates. It takes the form of
defaultStyleSetReference = <COMPONENT_REFERENCE>
When viewing a Style Set you can obtain this value by clicking on the icon to copy the reference to the clipboard. A sample expression is shown below.
defaultStyleSetReference="StyleSet`q_catalog|qf_Qarbine/general/Default"
System.servicesOnly
The system.servicesOnly are for the services endpoints. See the separate documents describing specific settings. This category is always active.
Calculation.defaults
The example Calculation.defaults are for both client side and services side usage.
Geographic Map and Lookup Services
There are several geographically related services provided by the geographicFunctions plugin.
- locateIpAddress
- locateStreetAddress
- whoIs
The system.defaults area contains the following entries:
- GeocoderWhoIs = computeHostUrl(':4000/dispatch?action=whoIs&host=')
- GeocoderLookupIP = accessHostUrl(':4000/dispatch?action=locateIpAddress&ip=')
- GeocoderLookupAddress= accessHostUrl(':4000/dispatch?action=locateStreetAddress&address=')
These URLs are used by macro functions to access the geographicFunctions endpoint within a specific compute node. In this example the functions are located on the main Qarbine compute node using the default port of 4000. On that host in the qarbine.service/config folder locate the service.NAME.json file. Be sure the following entry is defined.
"plugins" : [
"./plugin/geographicFunctions.js",
…
If it is not then edit the file and then restart the host to apply the settings. This can be done by SSH’ing into the host and running ‘pm2 restart all’.
The system.defaults also contains the following expression which is used by the custom map cell.
MapboxAccessToken = "pk.eyJ1I…”
Since some maps are rendered in client browsers the setting is within “System.defaults”. The values set within system.defaults are available at the end user level during report processing.
locateIpAddress
This service uses a local MaxMind database for country, city, and ASN lookups. The ‘which’ URL argument may be ‘country’,’ASN’, or ’city’. Sample ‘country’ output is shown below.
continentCode: ‘OC’,
continentName: 'Oceania', ← English
countryCode: 'US', ← the ISO code.
countryName: 'United States' ← English
The “city” output adds the following information.
location: {
accuracyRadius: 1000,
latitude: 37.751,
longitude: -97.822,
timeZone: 'America/Chicago'
}
The ASN output looks like the following
Asn {
autonomousSystemNumber: 217,
autonomousSystemOrganization: 'UMN-SYSTEM',
ipAddress: '128.101.101.101',
network: '128.101.0.0/16'
}
Who Is Usage
This service returns information from the ICANN database. A sample portion for google.com is shown below.
{
Domain Name: google.com
Registry Domain ID: 2138514_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.markmonitor.com
Registrar URL: http://www.markmonitor.com
Updated Date: 2019-09-09T08:39:04-0700
Creation Date: 1997-09-15T00:00:00-0700
Registrar Registration Expiration Date: 2028-09-13T00:00:00-0700
Registrar: MarkMonitor, Inc.
Registrar IANA ID: 292
Registrar Abuse Contact Email: abusecomplaints@markmonitor.com
Registrar Abuse Contact Phone: +1.2083895770
Registrant Organization: Google LLC
Registrant State/Province: CA
Registrant Country: US
Registrant Email: Select Request Email Form at Domain Status: clientUpdateProhibited (https://www.icann.org/epp#clientUpdateProhibited)
Domain Status: clientTransferProhibited (https://www.icann.org/epp#clientTransferProhibited)
…
}
locateStreetAddress
Qarbine provides an endpoint to lookup the geographic coordinates (latitude and longitude) given a place name or street address. The Google Maps services can be used to look up the geographic coordinates. Also,the Azure Maps Search service is a set of RESTful APIs designed to help developers search addresses, places, and business listings by name, category, and other geographic information. The return value is a Geo JSON object as depicted below.
{
"type": "Feature",
"properties": { "name": the long address string" },
"geometry": {
"type": "Point",
"coordinates": [longitude, latitude ]
}
}
Configuring for Google Maps
This interaction uses the endpoint
and the argument
key=<GoogleMapsApiKey>&address=<someAddress>
To obtain a Google Maps API key see https://developers.google.com/maps/documentation/embed/get-api-key
https://console.cloud.google.com/projectselector2/google/maps-apis/credentials
Once you have the key open the Qarbine Administration tool.
Activate the Settings tab
In the “System.servicesOnly” area add the entry
Configuration for Azure Maps
To obtain a Azure Maps API subscription key see
https://learn.microsoft.com/en-us/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account
https://learn.microsoft.com/en-us/azure/azure-maps/how-to-secure-daemon-app
Once you have the key open the Qarbine Administration tool.
Activate the Settings tab.
In the “System.servicesOnly” area add the entry
Defining the Qarbine Service Endpoint
This was discussed above and is repeated here for emphasis. Open the Administration tool.
Activate the Settings tab.
In the “System,defaults” area add the entry
This address points to the Qarbine host which has the geography support functions installed.